package com.ebocy.hammer.core.db;

import com.ebocy.hammer.core.db.DAOConstants.DBType;
import com.ebocy.hammer.core.db.mongo.cache.MongoDaoCache;
import com.ebocy.hammer.core.util.Config;

/**
 *2012-3-29@author yangshaobo
 *
 * @param <T>
 */
public class DaoManager {
	private static DaoManager daoManager = new DaoManager();

	public static DaoManager getInstance() {
		return daoManager;
	}

	@SuppressWarnings("unchecked")
	public IDao getDao(Class clazz) {
		DBType type = Config.dbType;
		switch (type) {
		case MONGODB:
			return MongoDaoCache.getInstance().get(clazz);
		}
		return null;
	}

}
